package com.mass.core.sys.dict.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.mass.core.sys.dict.model.SysDict;
import com.mass.core.sys.dict.services.SysDictServices;
import com.mass.core.utils.AjaxResponse;


@RestController
@RequestMapping("/sysDict")
public class SysDictController {

	@Autowired
	private SysDictServices sysDictServices;
	
	/**
	 * 
	* @Title: selectPage
	* @Description: 分页条件查询
	* @param page
	* @param limit
	* @param sysDict
	* @return AjaxResponse 返回类型   
	* @throws
	 */
	@RequestMapping("/selectPage")
	public AjaxResponse selectPage(Integer page,Integer limit,SysDict sysDict){
		return sysDictServices.selectPage(page, limit, sysDict);
	}
	
	/**
	 * 
	* @Title: validationTypeCode
	* @Description: 验证
	* @param typeCode
	* @param typeName
	* @param id
	* @return AjaxResponse 返回类型   
	* @throws
	 */
	@RequestMapping("/validationTypeCode")
	public AjaxResponse validationTypeCode(String typeCode,String typeName,Long id){
		return AjaxResponse.success(sysDictServices.validationTypeCode(typeCode, typeName, id));
	}
	/**
	 * 
	* @Title: selectByTypeCodes
	* @Description: 多个使用，隔开
	* @param typeCodes
	* @return AjaxResponse 返回类型   
	* @throws
	 */
	@RequestMapping("/selectByTypeCodes")
	public AjaxResponse selectByTypeCodes(String typeCodes){
		return AjaxResponse.success(sysDictServices.selectByTypeCodes(typeCodes));
	}
	/**
	 * 
	* @Title: insert
	* @Description: 添加
	* @param sysDict
	* @throws
	 */
	@RequestMapping("/insert")
	public AjaxResponse insert(SysDict sysDict){
		return AjaxResponse.success(sysDictServices.insert(sysDict));
	}
	/**
	 * 
	* @Title: update
	* @Description: 修改
	* @param sysDict
	* @throws
	 */
	@RequestMapping("/update")
	public AjaxResponse update(SysDict sysDict){
		return AjaxResponse.success(sysDictServices.update(sysDict));
	}
	/**
	 * 
	* @Title: delete
	* @Description: 删除
	* @param id
	* @throws
	 */
	@RequestMapping("/delete")
	public AjaxResponse delete(Long id){
		return AjaxResponse.success(sysDictServices.delete(id));
	}
	/**
	 * 
	* @Title: selectByTypeCode
	* @Description: 根据typeCode编码查询
	* @param typeCode
	* @throws
	 */
	@RequestMapping("/selectByTypeCode")
	public AjaxResponse selectByTypeCode(String typeCode){
		return AjaxResponse.success(sysDictServices.selectByTypeCode(typeCode));
	}
}
